/*
 * menuPlaylist.h
 *
 *  Created on: 18-oct-2008
 *      Author: hector
 */

#ifndef MENUPLAYLIST_H_
#define MENUPLAYLIST_H_

#include <stdlib.h>

#include "menu.h"
#include "libmpdclient.h"
#include "util.h"

#define POLLING_INTERVAL 1000
#define MAX_PLAYLIST_LENGTH 5000
#define PLAYLIST_DESC_SIZE 255

menu * createPlaylistMenu();

int handleXPlaylistMenu(void*, mpd_Connection*);
int handleTPlaylistMenu(void*, mpd_Connection*);
int handleSPlaylistMenu(void*, mpd_Connection*);
int handleCPlaylistMenu(void*, mpd_Connection*);

int handleUpPlaylistMenu(void*, mpd_Connection*);
int handleDownPlaylistMenu(void*, mpd_Connection*);

int handleRTPlaylistMenu(void*, mpd_Connection*);
int handleLTPlaylistMenu(void*, mpd_Connection*);

int initPlaylistMenu(void*, mpd_Connection*);
int paintPlaylistMenu(void*, mpd_Connection*);

int aboutToShowPlaylistMenu(void*, mpd_Connection*);
int aboutToHidePlaylistMenu(void*, mpd_Connection*);

int destroyPlaylistMenu(void*, mpd_Connection*);

typedef struct {

	int id;
	int pos;
	char description[PLAYLIST_DESC_SIZE];

}PlaylistEntry;

typedef struct {
	int selectedLine;
	int lines;
	int currentSong;
	int playlistVersion;
	int state;
	int random;

	PlaylistEntry entries[MAX_PLAYLIST_LENGTH];

} PlaylistMenuState;

#endif /* MENUPLAYLIST_H_ */
